package com.situ.mall.util;

/**
 * 进行图片服务器选择配置
 * @author Gao
 *
 */
public class ImageServerUtil {
	public static final EnumImageServer IMG_SERVER = EnumImageServer.QINIU;
	public enum EnumImageServer{
		LOCAL, QINIU
	}
	
	public static final String IMG_SERVER_LOCAL = "/pic/";
	public static final String IMG_SERVER_QINIU = "http://q9yofjrf0.bkt.clouddn.com/";

	/**
	 * 根据当前的图片服务器，拼接完整的图片的访问路径
	 * @param fileName 文件的名字，不包含路径
	 * @return
	 */
	public static String getImageFullUrl(String fileName) {
		if (IMG_SERVER == EnumImageServer.LOCAL) {
			return IMG_SERVER_LOCAL + fileName;
		} else {
			return IMG_SERVER_QINIU + fileName;
		}
	}
}